﻿#ifndef COMMANDBASE_H
#define COMMANDBASE_H

#include <QObject>
#include <QSharedPointer>
#include "API_CommandManager.h"
#include "BaseModule/GlobalEnums.h"

namespace ProjectManager
{
    class CaseModelBase;
}

namespace CommandManager
{
    /// @brief 命令基类
    class API_COMMANDMANAGER CommandBase : public QObject
    {
        Q_OBJECT

    public:
        CommandBase();
        ~CommandBase() = default;

        virtual bool execute() = 0;
        virtual void undo();
        virtual void redo();

        /// @brief 获取命令名称
        /// @return 命令名称
        QString getCmdName();

    protected :
        virtual void initCmdName();

    protected:
        QString m_cmdName;
    };
}

#endif //COMMANDBASE_H
